package main

import (
	"flag"


	"tcp"
	"strings"
	"fmt"
	"os"
)
func main() {
	flag.StringVar(&tcp.ProxyServerIp, "l", ":9897", "-l=0.0.0.0:9897 指定服务监听的端口")
	flag.StringVar(&tcp.List, "d", "127.0.0.1:1789,127.0.0.1:1788", "-d=127.0.0.1:1789,127.0.0.1:1788 指定后端的IP和端口,多个用','隔开")
	flag.Parse()
	tcp.TrueList = strings.Split(tcp.List, ",")
	if len(tcp.TrueList) <= 0 {
		fmt.Println("后端IP和端口不能空,或者无效")
		os.Exit(1)
	}
	tcp.ProxyServer()
}

//func main() {
//	flag.StringVar(&tcp.Ip, "l", ":1789", "-l=0.0.0.0:1789 指定服务监听的端口")
//	flag.Parse()
//	tcp.Server()
//}
